package com.bh.remote;

import com.bh.bean.User;
import com.bh.fallback.UserFallBack;
import com.bh.fallback.factory.UserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

//@FeignClient(value = "NEW-SYSTEM",fallback = UserFallBack.class)
@FeignClient(value = "NEW-SYSTEM",fallbackFactory = UserFallbackFactory.class)      //记录降级原因
public interface UserRemoteClient {

    @GetMapping("/user/query/{id}")
    public Map queryUser(@PathVariable("id") String id);

    @GetMapping("/user/login")
    public void login(@RequestParam("username") String username, @RequestParam("password") String password);


    @GetMapping("/user/test1")
    public void testGetMap(@RequestParam Map map);

    @PostMapping("/user/test2")
    public void testPostMap(@RequestBody Map map);

    @PostMapping("/user/test3")
    public void testPostUser(@RequestBody User user);

    @PostMapping("/user/test4")
    public void testStringQueryMap(@SpringQueryMap Map map);

    @PostMapping("/user/test5")
    public void testStringQueryUser(@SpringQueryMap User user);


}
